package com.qk.common.util;

/**
 *
 *
 * @author blusr
 * @version 1.0
 * @date 2025/10/14 18:36
 */
public class CurrentUserContextHolders {
    private static final ThreadLocal<Integer> USERID_CONTEXT = new ThreadLocal<>();
    private CurrentUserContextHolders() {}

    public static void setUserId(Integer userId) {
        USERID_CONTEXT.set(userId);
    }

    public static Integer getUserId() {
        return USERID_CONTEXT.get();
    }

    public static void clearUserId() {
        USERID_CONTEXT.remove();
    }
}
